<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ti_subscribe.*,com.lmpop.trade.ti_personal.*,com.lmpop.trade.ti_customer.*,com.lmpop.trade.ts_category.*,com.lmpop.trade.ti_channel.*" %>
<%@page import="java.util.*" %>
<html>
  <head>
    
    <title>查看商机订阅</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
</head>

<body>

  <% 
  
   	//Ti_customerInfo ti_customerInfo=new Ti_customerInfo();
	
		Ti_personalInfo ti_personalInfo = new Ti_personalInfo();
  
   	Ts_categoryInfo ts_categoryInfo = new Ts_categoryInfo();
   		Map catMap = ts_categoryInfo.getCatClassMap("2");
  
  	Ti_channelInfo channelinfo = new Ti_channelInfo();
		 String select = channelinfo.getSelchannelByTLevel("1");
  
  	String info_id="";
  	if(request.getParameter("info_id")!=null) info_id = request.getParameter("info_id");
  	Ti_subscribeInfo ti_subscribeInfo = new Ti_subscribeInfo();
  	List list = ti_subscribeInfo.getListByPk(info_id);
  	Hashtable map = new Hashtable();
  	if(list!=null && list.size()>0) map = (Hashtable)list.get(0);
  	
  	String user_id="",cust_id="",info_type="",keyword="",cat_id_group="",ch_id_group="",info_num="",send_type="",enabled="",rsrv_str1="",rsrv_str2="",rsrv_str3="",in_date="";
  	String user_name="",cust_name="";
  	if(map.get("user_id")!=null) user_id = map.get("user_id").toString();
  	if(map.get("cust_id")!=null) cust_id = map.get("cust_id").toString();
  	  	 user_name=ti_personalInfo.getPersonalNameByPersonalId(user_id);
  			 //cust_name =	ti_customerInfo.getCustNameByCustId(cust_id);
  			 
  	if(map.get("info_type")!=null) info_type = map.get("info_type").toString();
  	if(info_type.equals("0")) info_type="商品";
  		if(info_type.equals("1")) info_type="卖家资讯";
  			if(info_type.equals("0")) info_type="平台资讯";
 
  	if(map.get("keyword")!=null) keyword = map.get("keyword").toString();
  	if(map.get("cat_id_group")!=null) cat_id_group = map.get("cat_id_group").toString();
  	
  	  String catAttr[] = cat_id_group.split("\\|");
  		String cat_names ="";  
  		for(String catId:catAttr){
  		if(catMap.get(catId)!=null){
  		   cat_names +=catMap.get(catId).toString()+"&nbsp;&nbsp;";  
  			}
  		}
  		
  	if(map.get("ch_id_group")!=null) ch_id_group = map.get("ch_id_group").toString();
 
	  String output = "";
		 String classArr[] = ch_id_group.split("\\|");
			for( String ch_Id:classArr ){
		 		output += channelinfo.getChName(ch_Id) + "&nbsp;&nbsp;";
			}
  	
  	if(map.get("info_num")!=null) info_num = map.get("info_num").toString();
  	if(map.get("send_type")!=null) send_type = map.get("send_type").toString();
  		if(send_type.equals("1")) send_type="邮件";
  			if(send_type.equals("0")) send_type="站内信";
  	if(map.get("enabled")!=null) enabled = map.get("enabled").toString();
  		if(enabled.equals("1")) enabled="无效";
  			if(enabled.equals("0")) enabled="有效";
  	if(map.get("rsrv_str1")!=null) rsrv_str1 = map.get("rsrv_str1").toString();
  	if(map.get("rsrv_str2")!=null) rsrv_str2 = map.get("rsrv_str2").toString();
  	if(map.get("rsrv_str3")!=null) rsrv_str3 = map.get("rsrv_str3").toString();
  	if(map.get("in_date")!=null) in_date = map.get("in_date").toString();
	
	
	
	String _info_type = "",_enable="",_start_date="",_end_date="",_key_type="";

	if(request.getParameter("_key_type")!=null && !request.getParameter("_key_type").equals("")){
		_key_type = request.getParameter("_key_type");
	}
	
	if(request.getParameter("_info_type")!=null && !request.getParameter("_info_type").equals("")){
		_info_type = request.getParameter("_info_type");
	}
	
		if(request.getParameter("_enable")!=null && !request.getParameter("_enable").equals("")){
		_enable = request.getParameter("_enable");
	}
	
		if(request.getParameter("s_start_date")!=null && !request.getParameter("s_start_date").equals("")){
		_start_date = request.getParameter("s_start_date");
	}	
	
	if(request.getParameter("s_end_date")!=null && !request.getParameter("s_end_date").equals("")){
		_end_date = request.getParameter("s_end_date");
	}
	String iStart = "0";
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
    String para ="/program/admin/subscribe/index.jsp?_key_type="+_key_type+"&_enable="+_enable+"&s_start_date="
	+_start_date+"&s_end_date="+_end_date+"&_info_type="+_info_type+"&iStart="+Integer.parseInt(iStart);
  %>
	
	<h1>查看商机订阅</h1>
	
	<form action="/doTradeReg.do" method="post" name="addForm">
	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="10%">
				会员名称:
			</td>
			<td><%=user_name %>
			<td align="right" width="10%">
				企业名称:
			</td>
			<td colspan="3"><%=cust_name %></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				信息类型:
			</td>
			<td><%=info_type %>
			<td align="right" width="10%">
				关键字:
			</td>
			<td colspan="3" ><%=keyword %></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				商品分类:
			</td>
			<td><%=cat_names %>
			<td align="right" width="10%">
				资讯栏目:
			</td>
			<td colspan="3" ><%=output %></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				信息数量:
			</td>
			<td><%=info_num %>
			<td align="right" width="10%">
				发送类型:
			</td>
			<td colspan="3" ><%=send_type %></td>
		</tr>
		
		<tr>
			<td align="right" width="10%">
				是否有效:
			</td>
			<td><%=enabled %>
			<td align="right" width="10%">
				订阅时间:
			</td>
			<td colspan="3" ><%=in_date %></td>
		</tr>
	
	
		<input name="rsrv_str1" id="rsrv_str1" value="<%=rsrv_str1 %>" type="hidden" />
		<input name="rsrv_str2" id="rsrv_str2" value="<%=rsrv_str2 %>" type="hidden" />
		<input name="rsrv_str3" id="rsrv_str3" value="<%=rsrv_str3 %>" type="hidden" />
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
				<input type="hidden" name="bpm_id" value="5965" />
	  			<input type="hidden" name="info_id" value="<%=info_id %>" />
				<input type="hidden" name="jumpurl" value="<%=para%>" />
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='<%=para%>';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>
